Demographic stochasticity refers to chance events of individual mortality and reproduction (inevitable deviation in mean birth and death rates) (Lande et al., 2003).
# Toss a coin 10/100/10,000 times
# Generate random numbers from {0,1} with the same probability
# We assume: 1 - heads, 0 - tails
toss10 <- sample(c(0,1), size = 10, prob = c(0.5,0.5), replace = TRUE)
toss100 <- sample(c(0,1), size = 100, prob = c(0.5,0.5), replace = TRUE)
toss10k <- sample(c(0,1), size = 10000, prob = c(0.5,0.5), replace = TRUE)
# Record the results in a matrix
# Notice: sum = number of 1's = number of heads
results <- data.frame(c(sum(toss10), 10-sum(toss10)),
c(sum(toss100), 100-sum(toss100)),
c(sum(toss10k), 10000-sum(toss10k)))
colnames(results) <- c("10 tosses", "100 tosses", "10,000 tosses")
rownames(results) <- c("heads", "tails")
results
## 10 tosses 100 tosses 10,000 tosses
## heads 7 52 5051
## tails 3 48 4949
Environmental stochasticity often refers to temporal fluctuations in the probability of mortality and reproduction (unpredictable catastrophes) (Lande et al., 2003)
Sampling error (or sampling variance) is the measurement error in estimates of population size or density. Some researchers categorized it as a basic form of stochasticity (Lande et al., 2003), while some distinguished it from deterministic and stochastic factors (Mills, 2007).
To answer the question why population size tends to shrink because of stochasticity, we need to understand two important concepts–arithmetic and geometric means.
# Initialize
N0 <- 1
lambda <- matrix(rbinom(1600, 1, 0.5), ncol = 16)
lambda[lambda==1] <- 1.55
lambda[lambda==0] <- 0.55
# lambda is a 100-by-16 matrix
# Each row represents a possible population change in 16 years
# Calculate the outcomes, and plot
outcome <- N0*apply(lambda, 1, prod)
par(mfrow=c(1,2))
boxplot(outcome, main = "Boxplot with outliers",
ylab = "Final population size")
boxplot(outcome, outline = FALSE, main = "Boxplot without outliers")
# We assume that the mean exponential growth rate r_A = 0.3,
# and the noise term epsilon_t is a standard normal random variable,
# We look at a time period of 20 years
rA <- 0.3
e <- rnorm(20, mean = 0, sd = 1)
r <- data.frame(year = 1:20, zero = rA + e)
# Calculate exponential growth rates with positive lag-1 autocorrelation
# We compare different coefficients rho = 0.2, 0.5, 0.8
pos1 = replicate(20, rA + e[1])
for (i in 2:20) {
pos1[i] <- r[i,'zero'] + 0.2*(pos1[i-1] - rA)
}
r$pos1 <- pos1
pos2 = replicate(20, rA + e[1])
for (i in 2:20) {
pos2[i] <- r[i,'zero'] + 0.5*(pos2[i-1] - rA)
}
r$pos2 <- pos2
pos3 = replicate(20, rA + e[1])
for (i in 2:20) {
pos3[i] <- r[i,'zero'] + 0.8*(pos3[i-1] - rA)
}
r$pos3 <- pos3
# Plot the results
matplot(r[2:5], type = "b", pch=1, col = 1:4,
main = 'Exponential growth rates with different lag-1 autocorrelation coefficients',
xlab = 'year', ylab = 'exponential growth rate', lty = c(1,2,2,2))
legend(x = "bottomright", legend = c('rho = 0', 'rho = 0.2', 'rho = 0.5', 'rho = 0.8'),
col = 1:4, lty = c(1,2,2,2))
Now we move on to an important section, where we try to estimate the growth rate from data, assuming some very simple model. But first, let’s talk about different types of errors we might encounter.
Process error results from variation in true population size due to biotic or abiotic processes (Ahrestani et al., 2013).
# Create a dataframe
N <- data.frame(year = 0:8,
size = c(100, 120, 98, 152, 298, 302, 383, 575, 728))
# Calculate annual growth rates
lambda <- replicate(8, 0)
for (i in 1:8) {
lambda[i] <- N[i+1,'size']/N[i,'size']
}
# Calculate the geometric mean growth rate
lambda_avg <- prod(lambda)^(1/8)
# The average growth rate is 1.2816, which is the same as (728/100)^(1/8)
# Calculate the theoretical population size, assuming geometric growth
N$pred <- 100*lambda_avg^N$year
# Plot the results
plot(N$year, N$size, pch = 19, col = 'blue', main = 'Population growth with process error only',
xlab = 'year', ylab = 'size')
lines(N$year, N$pred, col = 'red', lty = 2)
legend(x = 'topleft', legend = c('data', 'prediction'), col = c('blue', 'red'), lty = c(1, 2))
Observation error results from variation in the methodology used to obtain the population size (Ahrestani et al., 2013).
# Create a dataframe, and calculate the log-transformed population sizes
N <- data.frame(year = 0:8,
size = c(100, 120, 98, 152, 298, 302, 383, 575, 728))
N$log <- log(N$size)
# Run a linear regression with log-transformed population sizes as response variables
# and year as predictor variables
lm1 <- lm(log~year, data = N)
# After running the regression, we obtain the following coefficients:
# (Intercept) 4.40771
# year 0.26756
# Plot the results
plot(N$year, N$log, pch = 19, col = 'blue', main = 'Population growth with observation error only',
xlab = 'year', ylab = 'log-transformed size')
abline(lm1, col = 'red', lty = 2)
legend(x = 'topleft', legend = c('data', 'prediction'), col = c('blue', 'red'), lty = c(1, 2))
Drever, M. C., Clark, R. G., Derksen, C., Slattery, S. M., Toose, P. and Nudds, T. D. (2012) Population vulnerability to climate change linked to timing of breeding in boreal ducks, Global Change Biology, 18:480–492.
Figures: (top left) © Nrik Kiran, Mallard (Anas platyrhynchos), Creative Commons CC-BY-SA-4.0 license; (top right) © Judy Gallagher, American Wigeon (Anas americana), Creative Commons CC-BY-2.0 license; (bottom left) © MPF, Greater Scaup (Aythya marila), Creative Commons CC-BY-SA-4.0 license; (bottom right) © Andy Reago & Chrissy McClarren, Surf scoter (Melanitta perspicillata), Creative Commons CC-BY-2.0 license
Ahrestani, F., Hebblewhite, M. and Post, E. (2013) The importance of observation versus process error in analyses of global ungulate populations. Sci Rep, 3:3125.
Albon, S. D., Clutton-Brock, T. H. and Guinness, F. E. (1987) Early development and population dynamics in red deer. II. Density-independent effects and cohort variation, J. Anim. Ecol., 56: 69–81.
Beck-Johnson, L. M., Nelson, W. A., Paaijmans, K. P., Read, A. F., Thomas, M. B. and Bjonstad, O. N. (2013) The Effect of Temperature on Anopheles Mosquito Population Dynamics and the Potential for Malaria Transmission. PLoS ONE, 8(11):e79276.
Benton, T. G., Grant, A. and Clutton-Brock, T. H. (1995) Does environmental stochasticity matter? Analysis of red deer life-histories on Rum, Evolutionary Ecology, 9:559–574.
Beverton, R. and Holt, S. J. (1957) On the Dynamics of Exploited Fish Populations. Ministry of Agriculture, Fisheries and Food, London, UK.
Case, T. (2000) An Illustrated Guide to Theoretical Ecology, Oxford University Press.
Lande, R., Engen, S. and Saether, B. (2003) Stochastic Population Dynamics in Ecology and Conservation, Oxford Series in Ecology and Evolution.
Mills, L. S. (2007) Conservation of Wildlife Populations: Demography, Genetics, and Management, Wiley-Blackwell Publishing.